"""
@Author : 合肥一元数智教育科技有限公司
@Date :  2025/3/13 11:19
@Description :   通用装饰器的定义

"""
import time


# 定义装饰器  通用装饰器
def decorator(func):
    def inner(*args):
        print('----上课时间到了----')
        result = func(*args)
        print('----下课时间到了----')
        return result

    return inner


@decorator  # teach = decorator(teach)
def teach():
    print('正在上课.....')
    time.sleep(2)


@decorator  # teach_param = decorator(teach_param)
def teach_param(teacher, course):
    print(f'{teacher}正在上{course}课.....')
    time.sleep(2)
    return f'{teacher}:{course}'


# inner(*args)
result = teach()
print(result)
result = teach_param('王老师', 'python')
print(result)
